/*
 * @Description: 
 * @Author: liuzl
 * @Date: 2024-09-10 11:29:46
 * @LastEditors: liuzl
 * @LastEditTime: 2024-09-11 19:24:12
 */
public class Duration{
    //��Ա����
    private int hour;
    private int min;
    private int sec;
    //private int seconds;

    //���췽��-�޲Ρ�-�޲ι�����
    public Duration(){
        System.out.println("�������޲ι�����");

    }
    //���췽��-�вΡ�-�вι�����-һ������
    public Duration(int seconds){
        System.out.println("������Duration��һ�ι�����");
        this.hour = seconds/3600;
        this.min = (seconds%3600)/60;
        this.sec = seconds%60;
    }
    public Duration(int hour,int min,int sec){
        System.out.println("������Duration�����ι�����");
        this.hour = hour;
        this.min = min;
        this.sec = sec;
        
    }
    public void setHour(int hour){
        this.hour = hour;
    }
    public int getHour(){
        return hour;
    }
    public void setMin(int min){
        this.min = min;
    }
    public int getMin(){
        return min;
    }
    public void setSec(int sec){
        this.sec = sec;
    }
    public int getSec(){
        return sec;
    }

    public int getTotalSeconds(){
        return hour * 3600+min*60+sec;
    }
    
    public void sayHello(){
        System.out.println("������:"+getTotalSeconds());
        System.out.println("ת��Ϊ"+hour+" Сʱ"+min+" ��"+sec+"��");
        
    }
    
}